#!/usr/bin/env python

import sqlalchemy as sa
import sqlalchemy.orm as sao
import sqlalchemy.ext.declarative as sad
from sqlalchemy.ext.hybrid import hybrid_property

from _base import Base

maker = sao.sessionmaker(autoflush=True, autocommit=False)
DbSession = sao.scoped_session(maker)

DeclarativeBase = sad.declarative_base(cls=Base)
metadata = DeclarativeBase.metadata

def init(engine):
    """Call me before using any of the tables or classes in the model."""
    DbSession.configure(bind=engine)

# remember to define __all__ in each module

from _document import Document
